Skip to content

fix: exclude pnpm symlink aliases from completed archives - #15

Merged
Harold Hunt (huntharo) merged 4 commits into
mainfrom
fix/completed-tree-archive-roots
Oct 28, 2026
Merged

Harold Hunt (huntharo) merged 4 commits into
mainfrom
fix/completed-tree-archive-roots

Conversation

@huntharo

@huntharo Harold Hunt (huntharo) commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Thanks for maintaining configure-nodejs. PwrGit uses it across hosted Linux/Windows and persistent macOS runners. Adopting completed pnpm trees exposed two archive portability failures.

The **/node_modules cache glob follows package symlinks and gives tar both workspace roots and nested dependency directories reached through aliases. Extraction then fails with directory and hard-link errors. After narrowing that manifest, Windows restored some directory aliases as file symlinks when their targets appeared later in the archive: readlink returned the correct relative target, but traversal returned EPERM and proper-lockfile could not load retry.

Exclude nested node_modules matches from the completed-tree manifest. Each workspace root remains recursively archived, preserving its packages, bin files and links. Record internal directory-link targets in the compatibility marker. After key/ABI validation, Windows restores the directory type only for recorded links whose existing source and internal target still match. Missing or changed edges fail; the action neither installs packages nor infers a dependency graph. Validate every metadata entry before changing any link. Default manager and persistent-store modes are unchanged; the implementation hash separates new completed archives from previous entries.

Validation Evidence
Linux Sandboxer, PwrGit's real tree Original glob selected 889 paths and failed extraction; excluding nested matches selected four intended roots and extracted cleanly.
Windows hosted PwrGit, first manifest fix Archive extraction passed; proper-lockfile import failed. The retry symlink had correct target text but stat returned EPERM.
Expanded pnpm 12 upstream fixture Reproduced the missing retry failure, then passed after the directory-link codec fix. It also executes a real lock operation after restore.
Unit tests All 142 passed locally on macOS and in Linux Sandboxer, including metadata boundaries, changed/missing edges and validation before mutation.

Extend the existing pnpm 10/12 lifecycle fixtures with a nested workspace root, package aliases and hard-linked bin files. Same-job and fresh-job consumers verify restored contents, symlinks and native esbuild, with no reinstall. Hosted Linux/macOS/Windows CI is validating the complete matrix. PwrGit PR pwrdrvr/PwrGit#513 is testing immutable fix SHA 311efb2f64811ab65d8943dd7c221de22c2f38d1 before merge or release.

@huntharo
Harold Hunt (huntharo) merged commit d416c1c into main Oct 28, 2026
37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant